touch inc.sh
touch inc.log
#shell脚本
#!/bin/bash
etl_date=`date -d '-1 days' +"%Y%m%d"`
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_dim_aml_customer.sql    > /aml/dwd/dim_aml_customer_$etl_date.log &
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_dim_aml_account.sql     > /aml/dwd/dim_aml_account.sql_$etl_date.log &
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_dim_aml_watchlist.sql   > /aml/dwd/dim_aml_watchlist_$etl_date.log &
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_dim_aml_rule.sql        > /aml/dwd/fact_aml_transaction_$etl_date.log &
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_fact_aml_screening.sql  > /aml/dwd/fact_aml_screening_$etl_date.log &
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_fact_aml_alert.sql      > /aml/dwd/fact_aml_alert_$etl_date.log &
nohup hive -hivevar etl_date=$etl_date -f /root/dwd_inc_fact_aml_str_report.sql > /aml/dwd/fact_aml_str_report_$etl_date.log &

rm -rf `find /root/aml/inc.log -mtime 2`

crontab -e
30 1 * * * bash /root/aml/inc.sh



